//
//  LSZSpecificTypePlayManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/28.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZSpecificTypePlayManager.h"
#import "JKSongsMessStatus.h"
#import "LCPlaylist.h"
#import "NetworkTool+LCAVPlay.h"
@implementation LSZSpecificTypePlayManager
-(id)initWithSpecificTypePlayManager :(NSDictionary *)dic strLastImageView:(NSString *)strLastImageView
{
    self = [super init];
    if (self) {
        NSMutableArray * arrayMut = [NSMutableArray array];
        self.mutDataArray = [NSMutableArray array];
        self.historyArrayData = [[NSMutableArray alloc]init];

        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        //播放列表添加到
        for (NSDictionary * diction in arrayData) {
            LSZSpecificTypePlayMg * playMg = [[LSZSpecificTypePlayMg alloc]init];
            playMg.album = [NSString stringWithFormat:@"%@",diction[@"album"]];
            playMg.duration = [NSString stringWithFormat:@"%@",diction[@"duration"]];
            playMg.fileUrl = [NSString stringWithFormat:@"%@",diction[@"fileUrl"]];
            playMg.id_id = [NSString stringWithFormat:@"%@",diction[@"id"]];
            playMg.n = [NSString stringWithFormat:@"%@",diction[@"n"]];
            playMg.parentId = [NSString stringWithFormat:@"%@",diction[@"parentId"]];
            playMg.singerName = [NSString stringWithFormat:@"%@",diction[@"singerName"]];
            playMg.title = [NSString stringWithFormat:@"%@",diction[@"title"]];
            playMg.image = [NSString stringWithFormat:@"%@",strLastImageView];
            if([diction objectForKey:@"click"]){
                playMg.originalClick  = NullStringjudgment(NSStr(diction[@"click"]));
                playMg.click  = [LSZSpecialPackaging theNumberViewsForTheAlbumAhanges:playMg.originalClick];
            }
            if([diction objectForKey:@"shareUrl"]){
                playMg.shareUrl   = NullStringjudgment(NSStr(diction[@"shareUrl"]));
            }
            [arrayMut addObject:playMg];
        }
        
        self.mutDataArray = arrayMut;
        [self.historyArrayData setArray:arrayData];
    }
    return self;
}
@end

@implementation LSZSpecificTypePlayMg

@end
